<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--商户管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/index.css" />
    <link rel="stylesheet" href="__PUBLIC__/Admin/css/addmchat.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/bootstrap-datetimepicker.css"/>
    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <!--<script src="__PUBLIC__/Admin/js/area.js"></script>-->
    <style>
        thead tr th{
            text-align: center;
        }
        tbody tr td{
            text-align: center;
        }
    </style>
</head>
<body>
<include file='Index/header'/>
<section>
    <!------------------导航-------------------------->
    <include file='Index/left'/>
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading">
            <ul class="breadcrumb">
                <li>
                    当前位置是&nbsp;:&nbsp;微信支付
                </li>
                <li class="active" style="color: #02b87f;"> 广告位列表</li>
            </ul>
        </div>
        <div class="panel" style="position:relative;">
            <div class="panel-heading addCharts" style="background:#ededed;">广告位列表</div>
            <div class="text-right" style="position:absolute;right:20px;top:4px;">
                <button data-toggle="modal" data-target="#myModal" type="button" name="Cashier" method="post"
                        action="" class="btn btn-info">添加广告
                </button>
            </div>
            <table class="table" data-toolbar="#toolbar">
                <thead>
                <tr>
                    <th data-type="0">编号</th>
                    <th data-type="1">广告标题</th>
                    <th data-type="2">投放类别</th>
                    <th data-type="3">投放时间</th>
                    <th data-type="4">结束时间</th>
                    <th data-type="5">投放地区</th>
                    <th data-type="6">展示次数</th>
                    <th data-type="7">点击次数</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="ad" id="vo">
                    <tr class="active">
                        <td>{$vo.id}</td>
                        <td>{$vo.title}</td>
                        <td>{$vo.leibie}</td>
                        <td>{$vo['t_stime']|date="Y-m-d H:i:s",###}</td>
                        <td>{$vo['t_etime']|date="Y-m-d H:i:s",###}</td>
                        <td>林州</td>
                        <td>{$vo.v_num}</td>
                        <td>{$vo.click_num}</td>
                        <td>修改|删除</td>
                    </tr>
                </volist>
                </tbody>
            </table>
        </div>
        <include file='Index/footer'/>
    </div>
</section>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    添加广告
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form" id="adform" method="post" action="">
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">广告标题</label>
                        <div class="col-sm-10">
                            <input type="text" name="title" class="form-control" id="title" placeholder="请输入标题">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="lastname" class="col-sm-2 col-xs-2 control-label text-right light30">交易时间</label>
                        <div class="col-sm-4 col-xs-4 time date  input-group" id="startime" onclick="time( & quot; startime & quot; )" style="float: left;padding-left: 15px;margin-right: 15px;">
                            <input type="text" class="form-control" name="starttime" id="startime1" placeholder="交易起始时间">
                            <span class="input-group-addon">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                        </div>
                        <div class="col-sm-4 col-xs-4 time input-group date" id="endtime" onclick="time( & quot; endtime & quot; )" style="float: left;padding-left: 15px;">
                            <input type="text" class="form-control" name="endtime" id="endtime1" placeholder="交易终止时间">
                            <span class="input-group-addon">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 col-xs-4 control-label">上传图片</label>
                        <div class="col-sm-10 ">
                            <input style="border: 1px solid #eee;text-indent: -15px;" class="col-sm-6 col-xs-5" type="file" id="uploadFile" name="img" onchange='filePatterFun()'>
                            <span style="margin-left: 15px;line-height: 27px;">图片格式为['jpg,jpeg,png,gif']</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">展示次数</label>
                        <div class="col-sm-10">
                            <input type="text" name="adshownum" class="form-control" id="adshownum" placeholder="请输入展示次数">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">点击次数</label>
                        <div class="col-sm-10">
                            <input type="text" name="adclicknum" class="form-control" id="adclicknum" placeholder="请输入点击次数">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">投放地区</label>
                        <div class="col-sm-10" style="padding-top: 5px;">
                            <select id="s_province" name="s_province" ></select>  
                            <select id="s_city" name="s_city" ></select>  
                            <select id="s_county" name="s_county"></select>
                            <script class="resources library" src="__PUBLIC__/Admin/js/area.js" type="text/javascript"></script>
                            <script type="text/javascript">_init_area();</script>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="sub()">
                    提交
                </button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

</body>
<script src="__PUBLIC__/Admin/js/commen.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    //验证图片格式
    function filePatterFun(){
        var filename = $("#uploadFile").val();
        var patterArr = ['jpg', 'png', 'jpeg', 'gif'];
        var strTip = "上传";
        if (filename == "") {
            alert("请先选择需要" + strTip + "的文件");
            return false;
        } else{
            var patter = eval("/(" + patterArr.join("|") + ")/");
            if (!patter.test(filename.substring(filename.lastIndexOf("."), filename.length).toLowerCase())) {
                alert("请选择后缀名为" + patterArr.join(",") + "的文件" + strTip);
                $("#uploadFile").val("");
                return false;
            }
            return true;
        }
    };
    function deleteFun(event){
        var id = $(event.target).data("id");
        $.ajax({
            type:"post",
            url:"",
            async:true,
            data:{
                id:1
            },
            success:function(data){
                if (data == 0){
                    alert("删除成功")
                }
            }
        });
    };
    function sub(){
        $("#adform").submit();
    }
</script>
</html>